﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string loginSession;
        HttpCookie loginCookies = Request.Cookies["LoginCookies"];

        if (Session["LoginSession"] != null && loginCookies != null)
        {
            loginSession = Session["LoginSession"].ToString();
            string formatString = "LoginSession={0}, LoginCookie={1}! 登录成功！";
            Label1.Text = String.Format(formatString, loginSession, loginCookies.Values["LoginCookie"]);
        }
        else if (Session["LoginSession"] == null && loginCookies == null)
            Label1.Text = "Session Error, Cookies Error! 登录失败！";
        else if (Session["LoginSession"] == null)
            Label1.Text = "Session Error! 登录失败！";
        else if (loginCookies == null)
            Label1.Text = "Cookies Error! 登录失败！";
    }
}
